<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR" import="java.io.*"%>
<html>
<head>
	<script language="JavaScript">
				function go(filename){	
					var hidden = document.getElementById("file1");
					hidden.value = filename;
					document.form1.action = "down.jsp";
					document.form1.submit();					
				}
	</script>

</head>
<body><form name="form1" method="post">
<input type="hidden" name="file1" ></input>
<%
	String dir = application.getRealPath("/upload");
	
	File file = new File(dir);
	
	File[] flist = file.listFiles();
	for(File f:flist){
		%>
		<a href=# onCLICK="go('<%=f.getName() %>')"><%=f.getName() %></a><br>
<%	} %>
</form>
</body>
</html>